﻿using System.Collections.Generic;
using System.Linq;
using Inscriptionem.Areas.Inscriptionem.Models.Enums;

namespace Inscriptionem.Areas.Inscriptionem.Models.Views
{
    public class CategoryCollectionViewModel
    {
        public CategoryCollectionViewModel()
        {
            var db = new ORM.DB();
            Sections = db.Sections.OrderBy(s => s.Order);
            Languages = db.Languages.OrderBy(l => l.Order);
            Categories = db.Categories.OrderBy(c => c.Order);
        }

        public IEnumerable<ORM.Section> Sections { get; protected set; }
        public IEnumerable<ORM.Language> Languages { get; protected set; }
        public IEnumerable<ORM.Category> Categories { get; protected set; }
        public OrderError Error { get; set; }
    }
}